#ifndef LAYERATTRIBUTETABLEDIALOG_H
#define LAYERATTRIBUTETABLEDIALOG_H

#include <QAction>
#include <QDialog>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QToolBar>

class GeoFeatureLayer;

namespace Ui {
class LayerAttributeTableDialog;
}

class LayerAttributeTableDialog : public QDialog
{
    Q_OBJECT

public:
    
    LayerAttributeTableDialog(GeoFeatureLayer* layerIn, QWidget *parent);
    ~LayerAttributeTableDialog();
signals:
    void sigUpdateOpengl();

public slots:
    void onUpdate();
    void onSelectRows();
    void onRemoveSelected();
    void onClearSelected();

public:
    void createWidgets();
    void createActions();
    void createToolBar();
    void setupLayout();

private:
    void readAttributeTable();

private:
    GeoFeatureLayer* layer;

    // widgets
    QTableWidget* tableWidget;

    // toolBar
    QToolBar* toolBar;

    // actions
    QAction* clearSelectedAction;
    QAction* removeRecorsdAction;
private:
    Ui::LayerAttributeTableDialog *ui;
};

#endif // LAYERATTRIBUTETABLEDIALOG_H
